package com.dubbo.controller;

import com.alibaba.dubbo.config.annotation.Reference;

import com.dubbo.service.HelloService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
    public class DemoConsumerController {

        @Reference(version = "${demo.service.version}",
                application = "${dubbo.application.id}",
                url = "dubbo://localhost:12345")
        private HelloService demoService;

        @RequestMapping("/sayHello")
        public String sayHello(@RequestParam String name) {
            return demoService.sayHello(name);
        }

    }

